//#region 引入文件，样式。。。
import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import helper from './lib/helper'
import service from '@/service/index'


import './lib/hotcss/hotcss'
import './assets/common.css'

import VeeValidate from 'vee-validate';
Vue.use(VeeValidate);
import 'mint-ui/lib/style.css'
import {Toast, Indicator} from 'mint-ui';
import { nextTick } from 'q';
Vue.component(Toast.name,Toast)
Vue.use(Indicator);
//#endregion

router.beforeEach((to, from, next) => {
  if (to.path != '/') {
    // 校验用户是否登录
    if (helper.getTypes(store.getters.getLoginUser) === 'Object') {
      next();
    } else {
      next('/');
    }
  } else {
    next();
  }
});

Vue.config.productionTip = false

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
